import dbus.service

class DbusBus(dbus.service.Object):
    parent = None
    def __init__(self, parent):
        busName = dbus.service.BusName('org.LinRemote.Server.Gui', bus = dbus.SessionBus(private=True))
        dbus.service.Object.__init__(self, busName, '/org/LinRemote/Server')
        self.parent = parent
    
    @dbus.service.method('org.LinRemote.Server.Gui')
    def changeImage(self, code, IP):
        self.parent.showWindow(code, IP)
    
    @dbus.service.method('org.LinRemote.Server.Gui')
    def removeImage(self):
        self.parent.removeImage()

    @dbus.service.method('org.LinRemote.Server.Gui')
    def running(self):
        return 'True'